<!DOCTYPE html>
<html class="x-admin-sm">
{include file='public/header'}
<script src="/admin/xadmin/lib/layui/upload.js" charset="utf-8"></script>
<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">回传</a>
            <a><cite>未充值用户列表</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" id="reload" title="刷新">
            <i class="layui-icon" style="line-height:30px"><i class="iconfont">&#xe6aa;</i></i>
        </a>
    </div>
    <div class="x-body">
        <div class="layui-row">
            <form class="layui-form">
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">激活日期：</label>
                    <div class="layui-inline" id="time">
                        <div class="layui-input-inline">
                            <input type="text" autocomplete="off" name="date" id="date" class="layui-input" placeholder="请选择激活日期">
                        </div>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">链接ID：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="link_id" placeholder="请输入链接ID" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label w-auto">计划ID：</label>
                    <div class="layui-input-inline" style='width:200px'>
                        <input type="text" name="advertiser_id" placeholder="请输入计划ID" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <button class="layui-btn" style="margin-left: 10px;" lay-submit lay-filter="searchList">搜索</button>
                <button type="reset" id="resetList" class="layui-btn layui-btn-primary">重置</button>
            </form>
        </div>
        <table id="notRechargeUserList" lay-filter="notRechargeUserList"></table>
    </div>
    <script type="text/html" id="tbBar">
        <a class="layui-btn layui-btn-xs" lay-event="back">回传</a>
    </script>
    <script>
        let list = {
            elem: '#notRechargeUserList'
            , toolbar: '#toolbarDemo'
            , url: '/cps/back/notRechargeUserList' //数据接口
            , id: 'notRechargeUserList'
            , limit:15
            , page:true
            , cols: [[ //表头
                { field: 'id', title: '用户ID',  align:'center', width: 150,}
                , { field: 'activation_time', title: '激活时间',  align:'center', }
                , { field: 'link_id', title: '链接ID',  align:'center', }
                , { field: 'advertiser_id', title: '计划ID',  align:'center', }
                , { toolbar: '#tbBar', title: '操作', align: 'center', fixed: 'right', width: 120 }
            ]]
        }
        tableList(list)
        layui.use('table', function () {
            var table = layui.table;
            table.on('tool(notRechargeUserList)', function (obj) {
                var event = obj.event;
                if (event === 'back') {
                    layer.prompt({title: '请输入回传金额（单位：元）', formType: 0}, function(pass, index){
                        layer.close(index);
                        AnyAjax('确认回传该用户吗？','/cps/back/manualReturn', { uid: obj.data.id,return_amount:pass }, 'notRechargeUserList')
                    });
                } 
            });
        });

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            //日期范围
            laydate.render({
                elem: '#date',
                format: 'yyyy-MM-dd',
            });
        })
    </script>
</body>

</html>